<template>
  <div class="templates-view">
    <div class="leftSidebar-container">
      <left-sidebar :datas="list" @update-view="updateView"></left-sidebar>
    </div>
    <div class="centerView-container">
      <router-view v-if="isRouterAlive"/>
    </div>
  </div>
</template>
<script>

  export default {
    name: "statistical",
    data() {
      return {
        list: [
          {
            title: "财务查询",
            iconType: "iconFont",
            pic: {
              defaultIcon: require("../../assets/img/public/default-avatar.jpg"),
              icon: require("../../assets/img/public/default-avatar.jpg"),
            },
            iconFont: "iconfont icon-caiwuchaxun",
              path: "/statistical/financialQuery",
          },
          {
            title: "门诊日志",
            iconType: "iconFont",
            pic: {
              defaultIcon: require("../../assets/img/public/default-avatar.jpg"),
              icon: require("../../assets/img/public/default-avatar.jpg"),
            },
            iconFont: "iconfont icon-menzhenrizhidengjibiao",
              path: "/statistical/serviceLog",
          },
          {
            title: "销售明细",
            iconType: "iconFont",
            pic: {
              defaultIcon: require("../../assets/img/public/default-avatar.jpg"),
              icon: require("../../assets/img/public/default-avatar.jpg"),
            },
            iconFont: "iconfont icon-xiaoshoumingxi",
              path: "/statistical/salesDetail",
          },
          {
            title: "医生工作统计",
            iconType: "iconfont icon-gongzuotongji",
            pic: {
              defaultIcon: require("../../assets/img/public/default-avatar.jpg"),
              icon: require("../../assets/img/public/default-avatar.jpg"),
            },
            iconFont: "el-icon-tickets",
              path: "/statistical/doctorWork",
          },
        ],
        isRouterAlive: true
      };
    },
    methods: {
      reload() {
        this.isRouterAlive = false;
        this.$nextTick(function () {
          this.isRouterAlive = true
        })
      },
      updateView: function () {
        this.reload()
        // if (this.$refs["routerView"].updateApi) {
        //   this.$refs["routerView"].updateApi();
        // }
      },
    }
  };
</script>
<style lang="scss" scoped>
  @import "@/assets/scss/statistical/index.scss";
</style>
